<!-- DOM和浏览器中的模式：长时间运行的脚本——Web Workers -->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Web Workers</title>
</head>

<body>
  <script type="text/javascript">
    var ww = new Worker('my_web_worker.js');
    ww.onmessage = function(event) {
      document.body.innerHTML +=
        "<p>message from the background thread: " + event.data + "</p>";
    };
  </script>
</body>

</html>
